import request from '@/utils/request'

// 查询公告数据列表
export function listAppAnnouncement(query) {
  return request({
    url: '/customer/v1/app/announcement/page',
    method: 'post',
    data: query
  })
}

// 查询公告数据详细
export function getAppAnnouncement(id, lang) {
  return request({
    url: '/customer/v1/app/announcement?id=' + id + '&lang=' + lang,
    method: 'get'
  })
}

// 新增公告数据
export function addAppAnnouncement(data) {
  return request({
    url: '/customer/v1/app/announcement',
    method: 'post',
    data: data
  })
}

// 修改公告数据
export function updateAppAnnouncement(data) {
  return request({
    url: '/customer/v1/app/announcement',
    method: 'put',
    data: data
  })
}

// 删除公告数据
export function delAppAnnouncement(id) {
  return request({
    url: '/customer/v1/app/announcement/' + id,
    method: 'delete'
  })
}

// 翻译公告数据
export function translateAppAnnouncement(id) {
  return request({
    url: '/customer/v1/app/announcement/translate?id=' + id,
    method: 'post',
    timeout: 60 * 60 * 1000
  })
}
